﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript">
        var myApp = {
            id: 0,
            next: function () {
                return this.id++;
            },
            reset: function () {
                this.id = 0;
            }
        }
        window.console && console.log(
            myApp.next(),
            myApp.next(),
            myApp.reset(),
            myApp.next()
        ) //0, 1, undefined, 0
    </script>
</head>
<body>
</body>
</html>
